package com.xindz.cn.mvptest.components.product.persenter;

import com.avos.avoscloud.AVException;
import com.avos.avoscloud.GetCallback;
import com.xindz.cn.mvptest.base.BasePresenter;
import com.xindz.cn.mvptest.components.product.data.ProductBean;
import com.xindz.cn.mvptest.components.product.model.ProductModel;
import com.xindz.cn.mvptest.components.product.view.ProductGetView;

/**
 * @name MvpTest
 * @class name：com.xindz.cn.mvptest.components.product.persenter
 * @describe describe
 * @anthor XINDZ
 * @time 2017/10/31 9:40
 * @change
 * @chang time
 * @class describe
 */
public class ProductGetPersenter extends BasePresenter<ProductGetView> {
    private ProductModel productModel;

    public ProductGetPersenter() {
        this.productModel = new ProductModel();
    }

    public void getProduct(String id) {
        productModel.getInBackground(id, new GetCallback<ProductBean>() {

            @Override
            public void done(ProductBean productBean, AVException e) {
                getView().getProduct(productBean, e);
            }
        });
    }
}
